from OrderDispatch.OrderDispatchInterface import OrderDispatchInterface
from OrderDispatch.OrderDispatchRL.Planning.Planner import Planner
import pandas as pd
import os

class OrderDispatchInterfaceImplRL(OrderDispatchInterface):
    """
    订单分配接口强化学习实现类
    """

    # def __init__(self):
    #     self.code_index_map = pd.read_excel(os.path.join(os.path.dirname(__file__), 'data/node_index_with_cluster.xlsx'))
    #     # self.code_index_map.set_index('index')['cluster'].to_dict()

    def dispatch_orders_to_robots(self, order_list, robot_list):
        planner = Planner()
        # 调用 Planning 类的 dispatch_order 方法进行分配
        matching_pairs = planner.dispatch_order(order_list, robot_list)


        return matching_pairs

